package com.david.files.mapper;

import com.david.files.pojo.Entity.FileEntity;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface FileMapper {
    @Insert("insert into file_info (name, app_name, category, file_type, url) VALUES (#{name}, #{appName}, #{category}, #{fileType},#{url})")
    void insertFile(FileEntity fileEntity);

    @Delete("delete from file_info where name = #{name} and app_name = #{appName} and category = #{category} and file_type = #{fileType}")
    void delete(FileEntity fileEntity);

    List<FileEntity> selectByEntity(FileEntity file);

    @Delete("delete from file_info where id = #{id}")
    void deleteById(Integer id);
}
